package com.hina.rec.endpoint.req.system;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 菜单创建请求
 *
 * @author liaosp
 * @date 2024-01-10
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "菜单创建请求")
public class MenuSaveReq {

    /**
     * 菜单名称
     */
    @Schema(description = "菜单名称", required = true)
    @NotBlank(message = "菜单名称不能为空")
    private String name;

    /**
     * 权限标识
     */
    @Schema(description = "权限标识")
    private String permission;

    /**
     * 菜单类型(1目录，2菜单，3按钮)
     */
    @Schema(description = "菜单类型(1目录，2菜单，3按钮)", required = true)
    @NotNull(message = "菜单类型不能为空")
    private Integer type;

    /**
     * 显示顺序
     */
    @Schema(description = "显示顺序")
    private Integer sort;

    /**
     * 父菜单ID(顶级ID是0)
     */
    @Schema(description = "父菜单ID(顶级ID是0)", required = true)
    @NotNull(message = "父菜单ID不能为空")
    private Integer parentId;

    /**
     * 路由地址
     */
    @Schema(description = "路由地址")
    private String path;

    /**
     * 重定向地址（目录用）
     */
    @Schema(description = "重定向地址")
    private String redirect;

    /**
     * 菜单图标
     */
    @Schema(description = "菜单图标")
    private String icon;

    /**
     * 组件路径
     */
    @Schema(description = "组件路径")
    private String component;

    /**
     * 打开方式：_self=当前窗口，_blank=新窗口
     */
    @Schema(description = "打开方式：_self=当前窗口，_blank=新窗口")
    private String target;

    /**
     * 菜单状态(0停用，1启用)
     */
    @Schema(description = "菜单状态(0停用，1启用)")
    private Boolean status;

    /**
     * 是否可见(0隐藏，1显示)
     */
    @Schema(description = "是否可见(0隐藏，1显示)")
    private Boolean visible;

    /**
     * 是否缓存
     */
    @Schema(description = "是否缓存")
    private Boolean keepAlive;

    /**
     * 是否总是显示
     */
    @Schema(description = "是否总是显示")
    private Boolean alwaysShow;
}